package com.mju.byc.Controllers;

import com.mju.byc.Bean.Book;
import com.mju.byc.Service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BookController {
    @Autowired
    BookService bookService;
    @GetMapping("getBookById")
    public Book getBookById(Integer id)
    {
        return bookService.getBookById(id);
    }
    @PostMapping("updateBook")
    public void updateBook(Book book)
    {
        bookService.updateBook(book);
    }
}
